﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ProcrastinationKit.Connectivity.Configuration
{
    public class PKPlugginsCollection: System.Configuration.ConfigurationElementCollection
    {
        public PKPluggin this[int index]
        {
            get
            {
                return base.BaseGet(index) as PKPluggin;

            }
            set
            {
                if (base.BaseGet(index) != null)
                {
                    base.BaseRemoveAt(index);
                }
                this.BaseAdd(index, value);
            }
        }

        protected override System.Configuration.ConfigurationElement CreateNewElement()
        {
            return new PKPluggin();
        }

        protected override object GetElementKey(System.Configuration.ConfigurationElement element)
        {
            return ((PKPluggin)element).Name;
        }

        public void Add(PKPluggin element)
        {
            base.BaseAdd(element);
        }
    }
}
